<template>
  <slide-verify
    :l="42"
    :r="10"
    :w="400"
    :h="200"
    :imgs="picArray"
    :show="false"
    slider-text="向右滑动完成验证"
    ref="slideverify"
    @success="onSuccess"
    @fail="onFail"
    @refresh="onRefresh"
    class="sel"
  ></slide-verify>
</template>

<script>
export default {
  name: "SliderVerify",
  data() {
    return {
      picArray: [
        require("@/assets/imgs/1.jpg"),
        require("@/assets/imgs/2.jpg"),
        require("@/assets/imgs/3.jpg"),
        require("@/assets/imgs/4.jpg"),
        require("@/assets/imgs/5.jpg"),
        require("@/assets/imgs/6.jpg"),
      ],
    };
  },
  methods: {
    onSuccess() {
      //往父级传递验证通过的函数
      this.$emit("success");
    },
    onReset() {
      //重置图片验证组件
      this.$refs.slideverify.reset();
    },
    onFail() {},
    onRefresh() {},
  },
};
</script>

<style lang="less" scoped>
html,
body {
  width: 100% !important;
  height: 100% !important;
}

.slide-verify {
  height: 100%;
  position: relative;
  bottom: 0;
  top: 0;
  right: 0;
  left: 0;
  margin: auto;
}
</style>